import { ref } from 'vue'
import {defineStore} from 'pinia'

export const useAppStore = defineStore('app', () => {
 const collapse = ref(false);
 const username=ref('')
 const token=ref('')


function toggleCollapseAction(){
  collapse.value=! collapse.value
}

function updateUsername(value) {
  username.value=value
}
function updateToken(value) {
  token.value=value
}

  return {collapse,username,token,toggleCollapseAction,updateToken }
},{
  persist: {
    key:'pinia.app',
    storage: sessionStorage,
    // pick: ['collapse'],
  },
})